package com.easytake.emotioncat.param;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.*;
import java.io.Serializable;
import java.time.LocalDate;

/**
 * 添加用户参数
 */
@Getter
@Setter
@Schema(title = "新增用户")
public class UserParams implements Serializable {

    @Schema(title = "电话号码")
    @NotBlank(message = "电话不能为空")
    @Pattern(regexp = "^1[0-9]{10}$", message = "电话号码不合法")
    private String phone;

    @Schema(title = "昵称")
    @NotBlank(message = "昵称不能为空")
    private String nickName;

    @Schema(title = "学校")
    @NotBlank(message = "学校不能为空")
    private String school;

    @Schema(title = "城市")
    private String city;

    @Schema(title = "签名")
    private String signature;

    @Schema(title = "性别 0-女,1-男")
    @NotNull(message = "性别不能为空")
    @Min(value = 0, message = "性别只能为0和1")
    @Max(value = 1, message = "性别只能为0和1")
    private Integer sex;

    /**
     * 生日
     */
    @Schema(title = " 生日")
    @NotNull(message = "生日不能为空")
    private LocalDate birth;

}
